1. Field of the Invention
The present invention relates to a computing device, a calculating method, and a program product.
2. Description of the Related Art
Conventionally, especially in image processing and graphics fields, a very large volume of computation is involved and real-time computation has to be repeated many times. However, such computation mostly has the following patterns.    (1) computation by matrix and vectors (for example, computation of the rotation of coordinate axes and so on)    (2) repetition of the same operation on a large number of data (for example, computation for inverting color of an entire image, and the like)
To meet a need for speeding up these processes, a function called SIMD (Single Instruction Multiple Data) (hereinafter, referred to as a SIMD function) is implemented in a CPU or a graphics card (GPU (Graphics Processing Unit)).
FIG. 1A to FIG. 1D are explanatory charts showing examples of the SIMD function.
In a regular operation, one operation is executed on one set of arguments in a single clock cycle of the CPU, but utilizing the SIMD function makes it possible to execute the same kind of operation on, for example, eight sets of arguments in a single clock cycle (in some operation, one of the arguments is not a vector but is a scalar). Some CPU implemented with the SIMD function is capable of a comparison operation (equal sign, magnitude relation) other than four operations, and depending on a library, is capable of calculating nonlinear functions such as exp(x), sin(x), and cos(x). Further, by using these libraries or the like, it is sometimes possible to speed up not only vector/matrix computations generally used in linear algebra but also nonlinear computation.
[Patent Document 1] Japanese Patent No. 3958662
Numerical calculating methods include a lattice method.
FIG. 2 is an explanatory chart of the lattice method. In FIG. 2, m represents a horizontal axis coordinate of a lattice. Further, in FIG. 2, l represents a vertical axis coordinate of the lattice. Note that FIG. 2 shows a trinomial lattice as an example of the lattice. The numerical computation in the lattice method comes in various patterns, but in many cases, values of all the nodes of the lattice can be computed successively by the same kind of operation. The lattice computation includes forward (rightward) computation and backward (leftward) computation, but the principle of the computation is the same for the both.
FIG. 3 is an explanatory chart of a method of the forward computation of values of nodes present on m=3.
In the forward computation of values of nodes (1), (2) present on m=3, a computing device uses, for the computation, values of black circular and white circular nodes present on m=2 respectively. Here, the values of the nodes differ depending on a model to which the lattice method is applied, but for example, when the lattice method is applied to financial engineering and the like, these values are stock quotes, interest rates, and the like. As for the values of the nodes, one node does not necessarily hold one value and one node sometimes holds a plurality of values. Further, taking a case where the values of the lattice are stock quotes as an example, the ups and downs shown in FIG. 3 represent probability change of the stock quotes.
FIG. 4 is a chart showing an example of a formula for calculating values of nodes. In FIG. 4, a function f depends on a model to which the lattice method is applied, on a method when the lattice method is applied to a model, or the like. When f is implemented by using SIMD, arguments of the function and return values are arrayed with the same length.
In the lattice method, the number of nodes is not fixed irrespective of the values of m as shown in FIG. 3. Specifically, for example, the number of nodes on m=2 and the number of nodes on m=3 are different (taking FIG. 1A to FIG. 1D as examples, the number of argument elements and the number of result elements are different). This does not allow the operation on vectors and thus has a problem that the SIMD function cannot be used (or applied). Therefore, there arises a problem that, even with a processor such as a CPU having the SIMD function, it is not possible to speed up computation processing due to the inability to use of the SIMD function in the computation using the lattice (lattice method).